// custom-tab-bar/index.js
Component({
  /**
   * 组件的初始数据
   */
  data: {
    selected: 0,
    selectedBgColor: '#333',
    bgColor: '#cdcdcd',
    list: [
      {
        pagePath: 'pages/square/square',
        text: '信息广场'
      },
      {
        pagePath: 'pages/signUp/signup',
        text: '报名预约'
      },
      // {
      //   "pagePath": "pages/plan/plan",
      //   "text": "每日计划"
      // },
      {
        pagePath: 'pages/my/my',
        text: '我的部落'
      }
    ]
  },
  /**
   * 组件的方法列表
   */
  methods: {
    switchTab(e) {
      wx.requestSubscribeMessage({
        tmplIds: ['CW-1eCXC5IK4TaxvoMqC36Y8hzEbACkDPvyOEDquiRs'],
        success(res) {
          console.log(res)
        },
        fail(err) {
          console.log(err)
        }
      })
      const data = e.currentTarget.dataset
      const url = '/' + data.path
      wx.switchTab({
        url
      })
      this.setData({
        selected: data.index
      })
    }
  }
})
